/**
 * 
 */
package view;

import java.awt.event.KeyEvent;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

/**
 * This class loads the {@link JMenuBar} for the Compose New Mail Window.
 * 
 * @author Farzana Alam (farzana22@gmail.com)
 * @since May 2013
 *
 * @version $Revision: 1.0 $
 */
@SuppressWarnings("serial")
public class ComposeMailMainMenu extends JMenuBar {
	
	/**
	 * {@link JMenu} instances.
	 */
	private JMenu fileMenu;
	
	/**
	 * {@link JMenuItem} instances of File {@link JMenu}.
	 */
	private JMenuItem newMessage, saveMail, sendMail, closeWindow;
	
	
	/**
	 * Constructs a {@link ComposeMailMainMenu} instance.
	 */
	public ComposeMailMainMenu() {
		setup();
		this.add(fileMenu);	
	}

	/**
	 * Setup the file menu
	 */
	private void setup() {

		fileMenu = new JMenu("File");
		fileMenu.setMnemonic(KeyEvent.VK_F);
		
		// New Message menu item
		newMessage = new JMenuItem("New Message");
		newMessage.setMnemonic(KeyEvent.VK_N);
		fileMenu.add(newMessage);
		
		// Save as Draft menu item
		saveMail = new JMenuItem("Save as draft");
		saveMail.setMnemonic(KeyEvent.VK_V);
		fileMenu.add(saveMail);
		fileMenu.addSeparator();
		
		// Send Now menu item 
		sendMail = new JMenuItem("Send");
		sendMail.setMnemonic(KeyEvent.VK_S);
		fileMenu.add(sendMail);
		
		// Close menu item
		closeWindow = new JMenuItem("Close");
		closeWindow.setMnemonic(KeyEvent.VK_O);
		fileMenu.add(closeWindow);
	}

	/**
	 * Getter for newMessage
	
	 * @return {@link JMenuItem} */
	public JMenuItem getNewMessage() {
		return newMessage;
	}

	/**
	 * Getter for saveMail.
	
	 * @return {@link JMenuItem} */
	public JMenuItem getSaveMail() {
		return saveMail;
	}

	/**
	 * Getter for sendMail.
	
	 * @return {@link JMenuItem} */
	public JMenuItem getSendMail() {
		return sendMail;
	}

	/**
	 * Getter for closeWindow.
	
	 * @return {@link JMenuItem} */
	public JMenuItem getCloseWindow() {
		return closeWindow;
	}	

}
